import HTMLTestRunner_cn,yagmail

class Tools():
    def html(self):
        report = HTMLTestRunner_cn.HTMLTestRunner(open('ceshi.html','wb'),
                                                  title='测试报告',
                                                  description='测试报告')
        return report

    def email(self,aa):
        email = yagmail.SMTP(user='2031077871@qq.com',password='ozcetyoqgxljbceh',host='smtp.qq.com')
        email.send(to='2031077871',subject='测试结果',preview_only=aa)
        email.close()